<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  
</head>
<style>
  * {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }
  body{
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  main{
    width: 200px;
    height: 100px;
    /* border: 1px solid red; */
    position: relative;
    transform-style: preserve-3d;
    transform-origin: center center -50px;
    transform: perspective(900px) rotateX(-60deg);
    transition: all 2s;
  }
  article:hover main{
    transform: perspective(900px) rotateX(-60deg) rotateY(360deg) rotateZ(360deg);
  }
   div{
    width: 100%;
    height: 100%;
    position: absolute;
    transform-origin: center center -50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .8;
    font-size: 70px;
   }
   div:nth-of-type(1){
    background-color: red;
   }
   div:nth-of-type(2){
    background-color:aqua;
    transform:rotateY(180deg)
   }
   div:nth-of-type(3){
    width: 100px;
    left: 0%;
    transform-origin: left;
    background-color:aquamarine;
    transform:rotateY(90deg)
   }
   div:nth-of-type(4){
    width: 100px;
    right: 0%;
    transform-origin: right;
    background-color:blueviolet;
    transform:rotateY(-90deg)
   }
   div:nth-of-type(5){
    background-color:#000;
    transform-origin: center bottom;
    transform:rotateX(90deg)
   }
   div:nth-of-type(6){
    background-color:#ccc;
    transform-origin: center top;
    transform:rotateX(-90deg)
   }
</style>
<body>
  <article>
    <main>
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
   </main>
  </article>
   <p></p>
</body>
<script>
    const p=document.querySelector("p")
    setTimeout(()=>{
// p.className ="gg"
// p.textContent="第一行\n第二行"
p.textContent=`第一行

第二行`
    },4000)
    
    
</script>
</html>
